package com.overseasShopping.Base.DAOImpl;

import java.util.List;

import com.overseasShopping.Base.DAO.ChatDAO;
import com.overseasShopping.pojo.Chat;
import com.overseasShopping.pojo.User;

public class ChatDAOImpl extends BaseDAOImpl<Chat> implements ChatDAO{

	public Chat getChat(String userId1,String userId2) {
		String hql="from Chat where chatFrom=? and chatTo=? order by id desc";
		Object[] parmes={userId1,userId2};
		List<Chat> chats=getHibernateTemplate().find(hql,parmes);
		return chats!=null&&chats.size()>0?chats.get(0):null;
	}

}
